\section{Finite Difference Schemes}
\newcommand{\pv}[2]{\ensuremath{\frac{\partial V^{#2}}{\partial #1^{#2}}}}
\newcommand{\iv}[2]{\ensuremath{V_{x#1}^{\tau#2}}}
\newcommand{\nv}[2]{\ensuremath{V_{#1}^{\tau#2}}}
\newcommand{\dt}{\ensuremath{\Delta \tau}}
\newcommand{\dx}{\ensuremath{\Delta x}}

\subsection{Forward Time Centered Scheme}
Equation \eqref{eq:ForwardTime} can be rewritten in the following equation
\begin{equation}
\iv{}{+1} = \iv{}{} + \frac{\mu\dt}{2\dx}(\iv{+1}{}-\iv{-1}{}) +
\frac{\sigma^2\dt}{2\dx^2}(\iv{+1}{} - 2\iv{}{} + \iv{-1}{}) - r\Delta\tau\iv{}{}.
\end{equation}
with $\mu = r-\frac{1}{2}\sigma^2$. We seek to rewrite the Forward Time
Centered Scheme (FTCS) to the form:
\begin{equation}\label{eq:rewrite}
a_1\iv{+1}{+1} + a_0\iv{}{+1} + a_{-1}\iv{-1}{+1} = 
 b_1\iv{+1}{} + b_0\iv{}{} + b_{-1}\iv{-1}{}
\end{equation}
for this FTCS has to be approximated with finite difference. \\
\newline
\noindent
Now take $\alpha = \frac{\mu\dt}{2\dx}$, $\beta = \frac{\sigma^2\dt}{2\dx^2}$
than the previous equation becomes:
\begin{align*}
\iv{}{+1} &= \iv{}{} + \alpha(\iv{+1}{}-\iv{-1}{}) +
\beta(\iv{+1}{} - 2\iv{}{} + \iv{-1}{}) - r\Delta\tau\iv{}{}\\
&=\iv{}{} + \alpha\iv{+1}{}-\alpha\iv{-1}{} + \beta\iv{+1}{} - 2\beta\iv{}{} +
 \beta\iv{-1}{} - r\Delta\tau\iv{}{}\\
&=(\alpha + \beta)\iv{+1}{} + (1 - 2\beta - r\Delta\tau)\iv{}{} + (\beta-\alpha)\iv{-1}{}
\end{align*}
we substitute the values for $\alpha$ and $\beta$ in the previous equation:
\begin{align*}
\iv{}{+1} &= \biggl(\frac{\mu\dt\dx}{2\dx^2} + \frac{\sigma^2\dt}{2\dx^2}\biggr)\iv{+1}{} +
 \biggl(\frac{\dx^2}{\dx^2} - \frac{2\sigma^2\dt}{2\dx^2} -
 \frac{r\Delta\tau\dx^2}{\dx^2}\biggr)\iv{}{} + 
 \biggl(\frac{\sigma^2\dt}{2\dx^2} - \frac{\mu\dt\dx}{2\dx^2} \biggr)\iv{-1}{}\\
\iv{}{+1} &= \frac{\mu\dt\dx + \sigma^2\dt}{2\dx^2}\iv{+1}{} + \frac{\dx^2 - \sigma^2\dt -
 r\Delta\tau\dx^2}{\dx^2}\iv{}{} + \frac{\sigma^2\dt - \mu\dt\dx}{2\dx^2}\iv{-1}{}\\
2\dx^2\iv{}{+1} &= (\mu\dt\dx + \sigma^2\dt)\iv{+1}{} + 2(\dx^2 - \sigma^2\dt -
 r\Delta\tau\dx^2)\iv{}{} + (\sigma^2\dt - \mu\dt\dx)\iv{-1}{}
\end{align*}
rewriting the last equation in the form of equation \eqref{eq:rewrite} gives
the $\bigl(a_1, a_0, a_{-1}\bigr) = \bigl(0, 2\dx^2, 0\bigr)$ and $\bigl(b_1,
b_0, b_{-1}\bigr) = \bigl((\mu\dt\dx + \sigma^2\dt), 2(\dx^2 - \sigma^2\dt - r\Delta\tau\dx^2),
(\sigma^2\dt - \mu\dt\dx)\bigr)$

\subsection{Crank-Nicolson Scheme}
The Crank-Nicolson Scheme, equation \eqref{eq:CrankNicolson}, can be rewritten to:
\begin{equation}\label{eq:cns}
\iv{}{+1} = \iv{}{} + \frac{\mu\dt}{4\dx}(\iv{+1}{+1} - \iv{-1}{+1} +
\iv{+1}{} - \iv{-1}{}) + \frac{\sigma^2\dt}{4\dx^2}(\iv{+1}{+1}-2\iv{}{+1} +
\iv{-1}{+1}+\iv{+1}{}-2\iv{}{}+\iv{-1}{}) - \frac{r\Delta\tau}{2}(\iv{}{+1}+\iv{}{})
\end{equation}
taking $\gamma = \frac{\mu\dt}{4\dx}$ and $\upsilon = \frac{\sigma^2\dt}{4\dx^2}$
we can simplify the previous equation to:
\begin{align*}
\iv{}{+1} = (1-\frac{r\Delta\tau}{2}-2\upsilon)\iv{}{} + 
 (\gamma + \upsilon)\iv{+1}{} +
 (\upsilon-\gamma)\iv{-1}{} + 
 (\gamma +\upsilon)\iv{+1}{+1} -
 (2\upsilon + \frac{r\Delta\tau}{2})\iv{}{+1} +
 (\upsilon - \gamma)\iv{-1}{+1}
\end{align*}
rearranging the terms gives:
\begin{align*}
 -(\gamma +\upsilon)\iv{+1}{+1} +
 (1+2\upsilon + \frac{r\Delta\tau}{2})\iv{}{+1} +
 (\gamma - \upsilon)\iv{-1}{+1}
&= (\gamma + \upsilon)\iv{+1}{} +
   (1-\frac{r\Delta\tau}{2}-2\upsilon)\iv{}{} + 
 (\upsilon-\gamma)\iv{-1}{} \\
\end{align*}
we substitute the values for $\gamma$ and $\upsilon$ in the previous equation:
\begin{multline*}
\frac{-\mu\dx\dt-\sigma^2\dt}{4\dx^2}\iv{+1}{+1} +
 \frac{2(1 + \frac{1}{2}r\Delta\tau)\dx^2 + \sigma^2\dt}{2\dx^2}\iv{}{+1} +
 \frac{\mu\dx\dt-\sigma^2\dt}{4\dx^2}\iv{-1}{+1}
=\\\frac{\mu\dx\dt+\sigma^2\dt}{4\dx^2}\iv{+1}{} +
 \frac{2(1-\frac{1}{2}r\Delta\tau)\dx^2-\sigma^2\dt}{2\dx^2}\iv{}{} +
 \frac{\sigma^2\dt-\mu\dt\dx}{4\dx^2}\iv{-1}{}
\end{multline*}

\begin{multline*}
\bigl(-\mu\dx\dt-\sigma^2\dt\bigr)\iv{+1}{+1} +
 \bigl(4(1 + \frac{1}{2}r\Delta\tau)\dx^2 + 2\sigma^2\dt\bigr)\iv{}{+1} +
 \bigl(\mu\dx\dt-\sigma^2\dt\bigr)\iv{-1}{+1}
=\\\bigl(\mu\dx\dt+\sigma^2\dt\bigr)\iv{+1}{} +
 \bigl(4(1-\frac{1}{2}r\Delta\tau)\dx^2-2\sigma^2\dt\bigr)\iv{}{} +
 \bigl(\sigma^2\dt-\mu\dt\dx\bigr)\iv{-1}{}
\end{multline*}
the variables in \eqref{eq:rewrite} are 
the $\bigl(a_1,\,a_0,\,a_{-1}\bigr) = \bigl((-\mu\dx\dt-\sigma^2\dt), \,(4(1 + \frac{1}{2}r\Delta\tau)\dx^2 +
2\sigma^2\dt), \,(\mu\dx\dt-\sigma^2\dt)\bigr)$ and $\bigl(b_1,\,b_0,\,b_{-1}\bigr)
= \bigl((\mu\dx\dt+\sigma^2\dt),\,(4(1-\frac{1}{2}r\Delta\tau)\dx^2-2\sigma^2\dt),\,(\sigma^2\dt-\mu\dt\dx)\bigr)$

\subsection{Matrix Representation}
These iterative equations can be solved by solving the following matrix representation.

\begin{equation}
\begin{pmatrix}
a_0&a_1&0&\dotsm&\dotsm&0\\
a_{-1}&a_0&a_1&0&\dotsm&0\\
0&\ddots&\ddots&\ddots&\ddots&\\
&\ddots&\ddots&\ddots&\ddots&\\
&&\ddots&\ddots&\ddots&a_1\\
0&\dotsm&\dotsm&0&a_{-1}&a_0
\end{pmatrix}
\begin{pmatrix}
\nv{1}{+1}\\
\nv{2}{+1}\\
\vdots\\
\vdots\\
\vdots\\
\nv{N}{+1}
\end{pmatrix}
=
\begin{pmatrix}
c_1\\
c_2\\
\vdots\\
\vdots\\
\vdots\\
c_N
\end{pmatrix}
\end{equation}
with
\begin{align*}
c_1 &= b_1\nv{2}{}+b_0\nv{1}{}+b_{-1}\nv{0}{}-a_{-1}\nv{0}{+1}&\\
c_i &= b_1\nv{i+1}{}+b_0\nv{i}{}+b_{-1}\nv{i-1}{}&\forall i = 2, \cdots, N - 1\\
c_N &= b_1\nv{N+1}{}+b_0\nv{N}{}+b_{-1}\nv{N-1}{}-a_{1}\nv{N+1}{+1}&\\
\end{align*}
The boundary conditions are $V_{X_{min}}^{\tau}=e^{-r\tau}(e^{X_{min}}-K)^+$,
$V_{X_{max}}^{\tau}=e^{-r\tau}(e^{X_{max}}-K)^+$,
$V_{x}^{\tau=0}=e^{-r\tau}(e^x-K)^+$, $\forall x\in(X_{min},X_{max})$ and $\tau=T-t$.
The Finite Difference schemes calculate iteratively the value $V_x^{\tau=T}$
of the option, by solving the equations of the matrix.



% vim: spell spelllang=en,nl:ft=tex:autoindent
